[#ftl]
[#include "commonDef.ftl" /]
[#assign f_add="add" f_edit="edit" f_query="page" f_detail="detail" f_del="del" f_req="req" f_res="res"/]

<template>
<div class="app-container">
   <!-- 查询条件-${data_main.moduleKeyName} -->
   [#assign mdx=map_method[f_query] eList=mdx.orderEntitys[f_req]![] /]
   <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      [#list eList as b]
      [#if isFieldUseTypeFunc(b,["1","2"]) && isJavaTypeFunc(b,dateJavaTypes) && isConditionSymbolFunc(b,["bw"])]
      daterange${b.fieldJavaCode?cap_first}: [],
      [#elseif isFieldUseTypeFunc(b,["1","2"])]
      [#if b.componentType=="input"]
      <el-form-item label="${b.fieldTitle}" prop="${b.fieldJavaCode}">
        <el-input v-model="queryParams.${b.fieldJavaCode}" placeholder="请输入${b.fieldTitle}"
          clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      [#elseif b.componentType=="select" || b.componentType=="radiobox"]
       <el-form-item label="${b.fieldTitle}" prop="${b.fieldJavaCode}">
        <el-select v-model="queryParams.${b.fieldJavaCode}" placeholder="请选择${b.fieldTitle}" clearable>
          [#if b.inputDict?trim?length>0 ]
          <el-option v-for="dict in dict.type['${b.inputDict}']" :key="dict.value" :label="dict.label" :value="dict.value" />
          [#else]
           <el-option label="请选择字典生成" value="" />
          [/#if]
        </el-select>
      </el-form-item>
      [#elseif b.componentType=="checkbox"]
      [#elseif b.componentType=="radiobox"]
      [#elseif b.componentType=="table"]
      [#elseif b.componentType=="dateinput" || (isJavaTypeFunc(b,dateJavaTypes) && isConditionSymbolFunc(b,["bw"]))]
      <el-form-item label="${b.fieldTitle}" prop="${b.fieldJavaCode}"  >
        <el-date-picker v-model="queryParams.${b.fieldJavaCode}" type="date" 
        value-format="yyyy-MM-dd" placeholder="请选择${b.fieldTitle}" clearable >
        </el-date-picker>
      </el-form-item>
      [#elseif b.componentType=="dateinput" || (isJavaTypeFunc(b,dateJavaTypes) && !isConditionSymbolFunc(b,["bw"]))]
      <el-form-item label="${b.fieldTitle}">
        <el-date-picker v-model="daterange${b.fieldJavaCode?cap_first}" style="width: 240px"
          value-format="yyyy-MM-dd" type="daterange" range-separator="-" 
          start-placeholder="开始日期" end-placeholder="结束日期" ></el-date-picker>
      </el-form-item>
      [#else]
      <el-form-item label="${b.fieldTitle}" prop="${b.fieldJavaCode}">
        <el-input v-model="queryParams.${b.fieldJavaCode}" placeholder="请输入${b.fieldTitle}"
           clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      [/#if]
      [/#if]
      [/#list]
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>
 <!-- 功能按钮-${data_main.moduleKeyName} -->
   <el-row :gutter="10" class="mb8">
   [#list data_method as mdx]
   [#if mdx.needFlag == '1' && !checkTypeFunc(mdx.methodKey,[f_query,f_detail]) ]
        <el-col :span="1.5">
        <el-button type="${mdx.fieldEx['btnClass']!''}" plain icon="${mdx.fieldEx['btnIcon']!''}" size="mini" [#if !checkTypeFunc(mdx.methodKey,[f_add])]:disabled="single"[/#if]
             @click="${mdx.methodCode1}Handler" v-hasPermi="['${PermissionFunc(data_main,mdx.methodCode1)}']" >${mdx.methodKeyName}</el-button>
       </el-col>
   [/#if]
   [/#list]
   <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
   </el-row>
 
  <!-- 查询表格-${data_main.moduleKeyName} -->
 [#assign mdx=map_method[f_query] eList=mdx.orderEntitys[f_res]![] /]
 <el-table v-loading="loading" :data="${TableListNameFunc(data_main)}" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
       [#list eList as b]
       [#if isFieldUseTypeFunc(b,["1","2"]) ]
       [#if b.componentType=="dateinput"]
       <el-table-column label="${b.fieldTitle}" align="center" prop="${b.fieldJavaCode}" width="${(b.inputClass?length!=0)?then(b.inputClass,'180')}">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.${javaField}, '{y}-{m}-{d}') }}</span>
        </template>
       </el-table-column>
       [#elseif b.componentType=="imginput"]
         <el-table-column label="${b.fieldTitle}" prop="${b.fieldJavaCode}" align="center" width="${(b.inputClass?length!=0)?then(b.inputClass,'100')}">
         <template slot-scope="scope">
          <image-preview :src="scope.row.${b.fieldJavaCode}" :width="50" :height="50"/>
         </template>
         </el-table-column>
       [#elseif b.inputDict?trim?length>0 ]
         <el-table-column label="${b.fieldTitle}" align="center" prop="${b.fieldJavaCode}">
         <template slot-scope="scope">
        [#if b.componentType=="checkbox"]
          <dict-tag :options="dict.type['${b.inputDict}']" :value="scope.row.${b.fieldJavaCode} ? scope.row.${b.fieldJavaCode}.split(',') : []"/>
        [#else]
          <dict-tag :options="dict.type['${b.inputDict}']" :value="scope.row.${b.fieldJavaCode}"/>
        [/#if]
        </template>
        </el-table-column>
       [#else]
       <el-table-column align="center" label="${b.fieldTitle}" prop="${b.fieldJavaCode}" width="${(b.inputClass?length!=0)?then(b.inputClass,'')}" />
       [/#if]
       [/#if]
       [/#list]
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
         [#list data_method as mdx]
         [#if mdx.needFlag == '1' && (checkTypeFunc(mdx.methodKey,[f_edit,f_del,f_detail]) || checkTypeFunc(mdx.methodOprType,["doedit","dodelete","getdetail"]))]
          <el-button size="mini" type="text"  icon="${mdx.fieldEx['btnIcon']!''}" @click="${mdx.methodCode1}Handler(scope.row)" 
             v-hasPermi="['${PermissionFunc(data_main,mdx.methodCode1)}']">${mdx.methodKeyName}</el-button>
         [/#if]
         [/#list]
        </template>
      </el-table-column>
    </el-table>
 
  <!-- 分页栏-${data_main.moduleKeyName} -->
     <pagination v-show="total>0" :total="total":page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"  @pagination="getList"
    />
    
    [#if map_method[f_add]?? || map_method[f_edit]?? || map_method[f_detail]??]
    [#if map_method[f_add]?? || map_method[f_edit]??]
    [#assign mdx=(map_method[f_add]??)?then(map_method[f_add],map_method[f_edit]) eList=mdx.orderEntitys[f_req]![] ]
    [#else]
    [#assign mdx=map_method[f_detail] eList=mdx.orderEntitys[f_res]![] ]
    [/#if]
    <!-- 添加或修改对话框-${data_main.moduleKeyName} -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
      [#list eList as b]
      [#if isFieldUseTypeFunc(b,["1","2"])]
      [#if b.componentType=="input"]
      <el-form-item label="${b.fieldTitle}" prop="${b.fieldJavaCode}">
          <el-input v-model="form.${b.fieldJavaCode}" placeholder="请输入${b.fieldTitle}" minlength="${b.minVal}" maxlength="${b.maxVal}" />
      </el-form-item>
      [#elseif b.componentType=="select" && b.inputDict?trim?length>0 ]
        <el-form-item label="${b.fieldTitle}" prop="${b.fieldJavaCode}">
          <el-select v-model="form.${b.fieldJavaCode}" placeholder="请选择${b.fieldTitle}">
            <el-option v-for="dict in dict.type['${b.inputDict}']" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
          </el-select>
        </el-form-item>
      [#elseif b.componentType=="select" ]
        <el-form-item label="${b.fieldTitle}" prop="${b.fieldJavaCode}">
          <el-select v-model="form.${b.fieldJavaCode}" placeholder="请选择${b.fieldTitle}">
            <el-option label="请选择字典生成" value=""></el-option>
          </el-select>
        </el-form-item>
      [#elseif b.componentType=="text" ]
       <el-form-item label="${b.fieldTitle}" prop="${b.fieldJavaCode}" >
          <el-input v-model="form.${b.fieldJavaCode}" type="textarea" placeholder="请输入内容" minlength="${b.minVal}" maxlength="${b.maxVal}" />
        </el-form-item>
      [#elseif b.componentType=="checkbox" && b.inputDict?trim?length>0]
       <el-form-item label="${b.fieldTitle}" prop="${b.fieldJavaCode}">
          <el-checkbox-group v-model="form.${b.fieldJavaCode}">
            <el-checkbox
              v-for="dict in dict.type.['${b.inputDict}']"
              :key="dict.value" :label="dict.value">
              {{dict.label}}
            </el-checkbox>
          </el-checkbox-group>
        </el-form-item>
      [#elseif b.componentType=="checkbox"]
       <el-form-item label="${b.fieldTitle}" prop="${b.fieldJavaCode}">
          <el-checkbox-group v-model="form.${b.fieldJavaCode}">
            <el-checkbox>请选择字典生成</el-checkbox>
          </el-checkbox-group>
        </el-form-item>
      [#elseif b.componentType=="radiobox" && b.inputDict?trim?length>0]
         <el-form-item label="${b.fieldTitle}" prop="${b.fieldJavaCode}">
          <el-radio-group v-model="form.${b.fieldJavaCode}">
            <el-radio
              v-for="dict in dict.type['${b.inputDict}']"
              :key="dict.value"
              :label="dict.value"
            >{{dict.label}}</el-radio>
          </el-radio-group>
        </el-form-item>
      [#elseif b.componentType=="radiobox"]
       <el-form-item label="${b.fieldTitle}" prop="${b.fieldJavaCode}">
          <el-radio-group v-model="form.${b.fieldJavaCode}">
            <el-radio label="1">请选择字典生成</el-radio>
          </el-radio-group>
        </el-form-item>
      [#elseif b.componentType=="imginput"]
       el-form-item label="${b.fieldTitle}" prop="${b.fieldJavaCode}">
          <image-upload v-model="form.${b.fieldJavaCode}"/>
       </el-form-item>
      [#elseif b.componentType=="fileinput"]
       <el-form-item label="${b.fieldTitle}" prop="${b.fieldJavaCode}">
          <file-upload v-model="form.${b.fieldJavaCode}"/>
        </el-form-item>
      [#elseif b.componentType=="editor"]
       <el-form-item label="${b.fieldTitle}">
          <editor v-model="form.${b.fieldJavaCode}" :min-height="192"/>
       </el-form-item>
      [#elseif b.componentType=="dateinput"]
       <el-form-item label="${b.fieldTitle}" prop="${b.fieldJavaCode}">
          <el-date-picker clearable
            v-model="form.${b.fieldJavaCode}"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择${b.fieldTitle}">
          </el-date-picker>
        </el-form-item>
      [#elseif b.componentType=="table"]
      <!-- ${b.fieldJavaCode} 这里应该是个子对象！！！ -->
       <el-form-item label="${b.fieldTitle}" prop="form.${b.fieldJavaCode}">
       [#assign eList2=b.children![] /]
       <el-table v-loading="loading" :data="form.${b.fieldJavaCode}" >
      <el-table-column type="selection" width="55" align="center" />
       [#list eList2 as b]
       [#if isFieldUseTypeFunc(b,["1","2"]) ]
       [#if b.componentType=="dateinput"]
       <el-table-column label="${b.fieldTitle}" align="center" prop="${b.fieldJavaCode}" width="${(b.inputClass?length!=0)?then(b.inputClass,'180')}">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.${javaField}, '{y}-{m}-{d}') }}</span>
        </template>
       </el-table-column>
       [#elseif b.componentType=="imginput"]
         <el-table-column label="${b.fieldTitle}" prop="${b.fieldJavaCode}" align="center" width="${(b.inputClass?length!=0)?then(b.inputClass,'100')}">
         <template slot-scope="scope">
          <image-preview :src="scope.row.${b.fieldJavaCode}" :width="50" :height="50"/>
         </template>
         </el-table-column>
       [#elseif b.inputDict?trim?length>0 ]
         <el-table-column label="${b.fieldTitle}" align="center" prop="${b.fieldJavaCode}">
         <template slot-scope="scope">
        [#if b.componentType=="checkbox"]
          <dict-tag :options="dict.type['${b.inputDict}']" :value="scope.row.${b.fieldJavaCode} ? scope.row.${b.fieldJavaCode}.split(',') : []"/>
        [#else]
          <dict-tag :options="dict.type['${b.inputDict}']" :value="scope.row.${b.fieldJavaCode}"/>
        [/#if]
        </template>
        </el-table-column>
       [#else]
       <el-table-column align="center" label="${b.fieldTitle}" prop="${b.fieldJavaCode}" width="${(b.inputClass?length!=0)?then(b.inputClass,'')}" />
       [/#if]
       [/#if]
       [/#list]
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button size="mini" type="text"  icon="" @click="" >删除</el-button>
        </template>
      </el-table-column>
      </el-table>
      </el-form-item>
      [#else]
      <el-form-item label="${b.fieldTitle}" prop="${b.fieldJavaCode}">
          <el-input v-model="form.${b.fieldJavaCode}" placeholder="请输入${b.fieldTitle}" minlength="${b.minVal}" maxlength="${b.maxVal}" />
      </el-form-item>
      [/#if]
      [/#if]
      [/#list]
      </el-form>
      <div slot="footer" class="dialog-footer">
        [#if map_method[f_add]?? || map_method[f_edit]??]
        <el-button type="primary" @click="submitForm">确 定</el-button>
        [/#if]
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
     [/#if]
</div>
</template>

<script>
import { [@JsImportMethod data_main data_method /] } from "@/api/${data_main.outputModulePath}/${name_apiUrl}";

export default {
  name: "${data_main.moduleKey}",
  [#if data_main.loadDict?length>0]dicts: [${data_main.loadDict}.split(",")],//加载字典[/#if]
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      ${TableListNameFunc(data_main)}: [],
      [#-- 子表处理--]
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      [#assign mdx=map_method[f_query] eList=mdx.orderEntitys[f_req]![] /]
      [#list eList as b]
      [#if isJavaTypeFunc(b,dateJavaTypes) && isConditionSymbolFunc(b,["bw"])]
      daterange${b.fieldJavaCode?cap_first}: [],//${b.fieldTitle}-时间范围
      [/#if]
      [/#list]
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        [#list eList as b]
        [#if isFieldUseTypeFunc(b,["1","2"])&&!(isJavaTypeFunc(b,dateJavaTypes)&&isConditionSymbolFunc(b,["bw"]))]${b.fieldJavaCode}: null,[/#if]
        [/#list]
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        [#if map_method[f_edit]??||map_method[f_add]??][#assign mdx=(map_method[f_add]???then(map_method[f_add],map_method[f_edit])) eList=mdx.orderEntitys[f_req]![] /]
        [#list eList as b]
        [#if b.checkPage?trim?length>0 && isFieldUseTypeFunc(b,["1","2"]) && !isConditionSymbolFunc(b,["bw"])]
        ${b.fieldJavaCode}:[ ${b.checkPage} ],
        [/#if]
        [/#list]
        [/#if]
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询列表 */
    getList() {
      this.loading = true;
      [#assign mdx=map_method[f_query] eList=mdx.orderEntitys[f_req]![] /]
      [#list eList as b]
      [#if isJavaTypeFunc(b,dateJavaTypes) && isConditionSymbolFunc(b,["bw"])]
      if (null != this.daterange${b.fieldJavaCode?cap_first} && '' != this.daterange${b.fieldJavaCode?cap_first}) {
        this.queryParams["begin${b.fieldJavaCode?cap_first}"] = this.daterange${b.fieldJavaCode?cap_first}[0];
        this.queryParams["end${b.fieldJavaCode?cap_first}"] = this.daterange${b.fieldJavaCode?cap_first}[1];
      }
      [/#if]
      [/#list]
      
      ${DlgMethodNameFunc(data_main,mdx)}(this.queryParams).then(response => {
        this.${TableListNameFunc(data_main)} = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
         //应该整个清空，字段多了费事，默认值才特殊处理.
      };
      [#-- 子表处理 --]
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      [#assign mdx=map_method[f_query] eList=mdx.orderEntitys[f_req]![] /]
      [#list eList as b]
      [#if isFieldUseTypeFunc(b,["1","2"]) && isConditionSymbolFunc(b,["bw"])]
      this.daterange${b.fieldJavaCode?cap_first} = [];
      [#elseif isFieldUseTypeFunc(b,["1","2"])]
      this.${b.fieldJavaCode} = null;
      [/#if]
      [/#list]
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      [#assign mdx=map_method[f_query] eList=mdx.orderEntitys[f_res]![] /]
      this.ids = selection;//整个放，有version和token
      this.single = selection.length!==1;
      this.multiple = !selection.length;
    },
    [#assign firstflag="0" ]
    [#list data_method as mdx]
    [#if mdx.needFlag == '1' && mdx.methodKey == f_add ]
    /** ${mdx.methodKeyName}按钮操作 */
    ${mdx.methodCode1}Handler() {
      this.reset();
      this.open = true;
      this.title = "${DlgTitleFunc(data_main,mdx)}";
      this.formOprType = "${DlgMethodNameFunc(data_main,mdx)}";
    },
    [/#if]
    [#if mdx.needFlag == '1' && mdx.methodKey == f_edit ]
    /** ${mdx.methodKeyName}按钮操作 */
    ${mdx.methodCode1}Handler(row) {
      this.reset();
      [#assign detail_mdx=map_method[f_detail] detail_eList = detail_mdx.orderEntitys[f_res]![]/]
      const data = (row.target && row.type == 'click')?this.ids[0]:row;
      ${DlgMethodNameFunc(data_main,detail_mdx)}(data).then(response => {
        this.form = response.data;
        [#list detail_eList as b]
        [#if isFieldUseTypeFunc(b,["1","2"]) && b.componentType=="checkbox"]
        this.form.${b.fieldJavaCode} = this.form.${b.fieldJavaCode}.split(",");
        [/#if]
        [/#list]
        [#-- 子表处理 --]
        this.open = true;
        this.title = "${DlgTitleFunc(data_main,mdx)}";
        this.formOprType = "${DlgMethodNameFunc(data_main,mdx)}";
      });
    },
    [/#if]
    [#if mdx.needFlag == '1' && checkTypeFunc(mdx.methodKey,[f_add,f_edit]) && firstflag=="0" ][#assign firstflag="1" ]
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          [#list data_method as mdx]
          [#if checkTypeFunc(mdx.methodKey,[f_edit,f_add])]
          [#if mdx.needFlag == '1']
          [#-- 子表处理 --]
          if (this.formOprType == "${DlgMethodNameFunc(data_main,mdx)}") {
            [#assign eList = mdx.orderEntitys[f_req]![]/]
            [#list eList as b]
            [#if isFieldUseTypeFunc(b,["1","2"]) && b.componentType=="checkbox"]
            this.form.${b.fieldJavaCode} = this.form.${b.fieldJavaCode}.join(",");
            [/#if]
            [/#list]
            ${DlgMethodNameFunc(data_main,mdx)}(this.form).then(response => {
              this.$modal.msgSuccess("操作成功");
              this.open = false;
              this.getList();
            });
          }
          [/#if]
          [/#if]
          [/#list]
        }
      });
    },
    [/#if]
    [#if mdx.needFlag == '1' && mdx.methodKey == f_detail]
    /** ${mdx.methodKeyName}按钮操作 */
    ${mdx.methodCode1}Handler(row) {
      this.reset();
      [#assign detail_mdx=map_method[f_detail] detail_eList = detail_mdx.orderEntitys[f_res]![]/]
      const data = (row.target && row.type == 'click')?this.ids[0]:row;
      ${DlgMethodNameFunc(data_main,detail_mdx)}(data).then(response => {
        this.form = response.data;
        [#list detail_eList as b]
        [#if isFieldUseTypeFunc(b,["1","2"]) && b.componentType=="checkbox"]
        this.form.${b.fieldJavaCode} = this.form.${b.fieldJavaCode}.split(",");
        [/#if]
        [/#list]
        [#-- 子表处理 --]
        this.open = true;
        this.title = "${DlgTitleFunc(data_main,mdx)}";
      });
    },
    [/#if]
    [#if mdx.needFlag == '1' && mdx.methodKey == f_del ]
    /** ${mdx.methodKeyName}按钮操作 */
    ${mdx.methodCode1}Handler(row) {
      [#assign mdx=map_method[f_del] eList = mdx.orderEntitys[f_req]![]/]
      const data = (row.target && row.type == 'click')?this.ids[0]:row;
      this.$modal.confirm('是否${mdx.methodKeyName}编号为"' + data.${(eList?size>0)?then(eList[0].fieldJavaCode,"")} + '"的数据项？').then(function() {
        return ${DlgMethodNameFunc(data_main,mdx)}(data);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("${mdx.methodKeyName}成功");
      }).catch(() => {});
    },
    [/#if]
    [#if mdx.needFlag == '1' && checkTypeFunc(mdx.methodOprType,["dodelete"]) && mdx.fieldEx['businessType']!"UPDATE"=="UPDATE" ]
    /** ${mdx.methodKeyName}按钮操作 */
    ${mdx.methodCode1}Handler(row) {
      [#assign mdx=map_method[f_del] eList = mdx.orderEntitys[f_req]![]/]
      const data = (row.target && row.type == 'click')?this.ids[0]:row;
      this.$modal.confirm('是否${mdx.methodKeyName}编号为"' + data.${(eList?size>0)?then(eList[0].fieldJavaCode,"")} + '"的数据项？').then(function() {
        return ${DlgMethodNameFunc(data_main,mdx)}(data);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("${mdx.methodKeyName}成功");
      }).catch(() => {});
    },
    [/#if]
    [/#list]
  }
};
</script>
[#function JsTableIdField eList ]
[#list eList as b]
[#if (b.fieldEx['tableIdFlag']!'')== '1' || b.primarykeyFlag== '1']
[#return b.fieldJavaCode /]
[/#if]
[/#list]
[#return "未设置唯一id" /]
[/#function]